]> dgit.raspbian.org Git - gnome-shell.git/commit
st/theme-node-drawing: Factor in border radius in update_resources()
authorJonas Dreßler <verdre@v0yd.nl>
Thu, 6 Jun 2024 15:13:27 +0000 (18:13 +0300)
committerMarge Bot <marge-bot@gnome.org>
Fri, 21 Jun 2024 15:32:34 +0000 (15:32 +0000)
commite1868cab1a1091ac26a1117fc49bf1e059b2cd37
tree5558b3bd6e764f951402b1fa4a1d180c6f34c764
parentdc6f7a1289c7fa316180b9dc837561422675907e
st/theme-node-drawing: Factor in border radius in update_resources()

The reduced border radius from st_theme_node_reduce_border_radius() depends
on the allocation size, and when it changes, has_large_corners can change.
has_large_corners is used to determine whether to pre-render using cairo,
so that means a change to the allocation size can influence whether the
pre-render using cairo should happen or not.

On changes to the allocation size we don't want to call render_resources()
though, but just update_resources() instead. And since we know now that
changes to the allocation size might cause pre-rendering to get enabled
or disabled, we need to do the "should pre-render" checks in
update_resources(), too.

So factor out those "should pre-render" checks into a new function
st_theme_node_maybe_prerender_background(), and then call that function from
both render_resources() and update_resources().

This fixes rendering artifacts with borders or rounded corners after changes
to the actor size.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6567
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3354>
src/st/st-theme-node-drawing.c